#ifndef CHIP_H
#define CHIP_H

#include <QGraphicsItem>
#include <QGraphicsSceneMouseEvent>

class WoodenSolitaireScene;

class Chip : public QGraphicsItem
{

public:
    Chip(WoodenSolitaireScene *scene, int row, int col, int size, const QColor &color);

    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
    QPainterPath shape() const;
    QRectF boundingRect() const;

    int getRow();
    int getCol();

    enum { Type = UserType + 2 };

    int type() const
    {
        return Type;
    }

private:
    int size;
    QColor color;
    WoodenSolitaireScene *scene;
    QPointF prevPos;
    int row;
    int col;

protected:
    void mousePressEvent(QGraphicsSceneMouseEvent *event);
    void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
};

#endif // CHIP_H
